﻿using System;
namespace GtsServer.Model
{
	/// <summary>
	/// Notice:实体类(属性说明自动提取数据库字段的描述信息)
	/// </summary>
	[Serializable]
	public partial class Notice
	{
		public Notice()
		{}
		#region Model
		private int _id;
		private string _name;
		private DateTime _createtime;
		private DateTime _starttime;
		private DateTime _endtime;
		private int? _typeid;
        private string _noticeContent;
        private int _state;
        private int _type;
        private int _r;//颜色
        private int _g;
        private int _b;
        private bool? _isFullScre;//是否全屏
        private bool? _isStick;//是否置顶
        private bool? _isRoll;//是否滚动
        private int _taskID;

        public int TaskID
        {
            get { return _taskID; }
            set { _taskID = value; }
        }

        public bool? IsRoll
        {
            get { return _isRoll; }
            set { _isRoll = value; }
        }

        public bool? IsStick
        {
            get { return _isStick; }
            set { _isStick = value; }
        }
        public bool? IsFullScre
        {
            get { return _isFullScre; }
            set { _isFullScre = value; }
        }
        public int B
        {
            get { return _b; }
            set { _b = value; }
        }
        public int G
        {
            get { return _g; }
            set { _g = value; }
        }
        public int R
        {
            get { return _r; }
            set { _r = value; }
        }
        public int Type
        {
            get { return _type; }
            set { _type = value; }
        }
        public int State
        {
            get { return _state; }
            set { _state = value; }
        }
        public string NoticeContent {
            get {
                return _noticeContent;
            }
            set {
                _noticeContent = value;
            }
        }
		/// <summary>
		/// 
		/// </summary>
		public int ID
		{
			set{ _id=value;}
			get{return _id;}
		}
		/// <summary>
		/// 公告名称
		/// </summary>
		public string Name
		{
			set{ _name=value;}
			get{return _name;}
		}
		/// <summary>
		/// 创建时间
		/// </summary>
		public DateTime CreateTime
		{
			set{ _createtime=value;}
			get{return _createtime;}
		}
		/// <summary>
		/// 开始时间
		/// </summary>
		public DateTime StartTime
		{
			set{ _starttime=value;}
			get{return _starttime;}
		}
		/// <summary>
		/// 结束时间
		/// </summary>
		public DateTime EndTime
		{
			set{ _endtime=value;}
			get{return _endtime;}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? TypeID
		{
			set{ _typeid=value;}
			get{return _typeid;}
		}
		#endregion Model

	}

    public class NoticeShow : Notice
    {
        public NoticeShow()
        {
        }

        private string _typeName;

        public string TypeName
        {
            get { return _typeName; }
            set { _typeName = value; }
        }

        private string _stateName;

        public string StateName
        {
            get { return _stateName; }
            set { _stateName = value; }
        }

        public static void state(NoticeShow model)
        {
            foreach (var item in Enum.GetValues(typeof(EnumNoticeState)))
            {
                if (model.State == Convert.ToInt32(item))
                {
                    model.State = Convert.ToInt32(item.ToString());
                    break;
                }
            }
        }
    }

}

